package parser;

import java.util.Map;

public class Block implements Cloneable {

	private String blockName;
	private double x_coordinate;
	private double y_coordinate;
	private Map<String, IOPin> pinsList;
	private double horizontalLength;
	private double verticalLength;
	/* Capacitance coefficients */
	private double co_aBlock;
	private double co_bBlock;
	private double co_cBlock;

	public Block(double x_coordinate, double y_coordinate,
			Map<String, IOPin> pinsList, double horizontalLength,
			double verticalLength, double co_aBlock, double co_bBlock,
			double co_cBlock) {

		this.x_coordinate = x_coordinate;
		this.y_coordinate = y_coordinate;
		this.pinsList = pinsList;
		this.horizontalLength = horizontalLength;
		this.verticalLength = verticalLength;
		this.co_aBlock = co_aBlock;
		this.co_bBlock = co_bBlock;
		this.co_cBlock = co_cBlock;
	}

	public Block() {
		this.x_coordinate = 0.0;
		this.y_coordinate = 0.0;
		this.pinsList = null;
		this.horizontalLength = 0.0;
		this.verticalLength = 0.0;
		this.co_aBlock = 0.0;
		this.co_bBlock = 0.0;
		this.co_cBlock = 0.0;
	}

	public double getX_coordinate() {
		return x_coordinate;
	}

	public void setX_coordinate(double x_coordinate) {
		this.x_coordinate = x_coordinate;
	}

	public double getY_coordinate() {
		return y_coordinate;
	}

	public void setY_coordinate(double y_coordinate) {
		this.y_coordinate = y_coordinate;
	}

	public Map<String, IOPin> getPinsList() {
		return pinsList;
	}

	public void setPinsList(Map<String, IOPin> pinsList) {
		this.pinsList = pinsList;
	}

	public double getHorizontalLength() {
		return horizontalLength;
	}

	public void setHorizontalLength(double horizontalLength) {
		this.horizontalLength = horizontalLength;
	}

	public double getVerticalLength() {
		return verticalLength;
	}

	public void setVerticalLength(double verticalLength) {
		this.verticalLength = verticalLength;
	}

	public double getCo_aBlock() {
		return co_aBlock;
	}

	public void setCo_aBlock(double co_aBlock) {
		this.co_aBlock = co_aBlock;
	}

	public double getCo_bBlock() {
		return co_bBlock;
	}

	public void setCo_bBlock(double co_bBlock) {
		this.co_bBlock = co_bBlock;
	}

	public double getCo_cBlock() {
		return co_cBlock;
	}

	public void setCo_cBlock(double co_cBlock) {
		this.co_cBlock = co_cBlock;
	}

	public String getBlockName() {
		return blockName;
	}

	public void setBlockName(String blockName) {
		this.blockName = blockName;
	}

	public Block clone() {
		Block newBlock = new Block(x_coordinate, y_coordinate, pinsList,
				horizontalLength, verticalLength, co_aBlock, co_bBlock,
				co_cBlock);
		newBlock.setBlockName(blockName);
		return newBlock;
	}

}
